<%@page import="cn.yi.newsys.pojo.News"%>
<%@page import="cn.yi.newsys.service.impl.NewsServiceImpl"%>
<%@page import="cn.yi.newsys.service.NewsService"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>搜索结果页</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <h1>搜索结果：</h1>
    <%
    	String str = request.getParameter("sou") ;
    	NewsService ns = new NewsServiceImpl() ;
    	List<News> list = ns.getSearchNews(str) ;
    	if(list.size() > 0 && str.length() > 0){
    		for(News n : list ){
    %>
    <a href="newsread.jsp?id=<%=n.getNid() %>"><%=n.getTittle() %></a></br>
    <% 
    		}
    	}else{
    %>
    <p>暂无搜索结果<p>
    <%
    	}
     %>
     
  </body>
  
</html>
